package br.com.pjs;


import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.Spinner;
import android.widget.Toast;

public class PJS_AndroidActivity extends Activity {
    
private static final String[] NOMES = new String[]{"Artur","Paulo","Bruno","Edkarla","Daniel","Gustavo","Pedro Jr","Rafael","Wlysses","Davi"};
private Spinner nomes;
	
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        ArrayAdapter<String> adp2 = new ArrayAdapter<String>(this,android.R.layout.simple_dropdown_item_1line, NOMES);
        nomes = (Spinner) findViewById(R.id.spinner1);
        nomes.setAdapter(adp2);
        
        Button botao = (Button)findViewById(R.id.button1);
        botao.setOnClickListener(new View.OnClickListener() {
        	public void onClick(View v) {
        		Toast.makeText(getApplicationContext(),"O Aluno Selecionado foi: " + nomes.getSelectedItem().toString(), Toast.LENGTH_LONG).show();
        	}
        });
        
    }
}